﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net.Mail;
using System.Web;
using MailMessage = System.Net.Mail.MailMessage;

namespace Orion.MyLib
{
	public class EmailLogMedia : LogMedia
	{
		public override void LogMessage(string message)
		{
			using (MailMessage emailLog = new MailMessage())
			{
				string strEmail = ConfigurationManager.AppSettings["Email"];

				emailLog.To.Add(strEmail);
				emailLog.Subject = "Log vefforritun";
				emailLog.Body = message;

				SmtpClient client = new SmtpClient();
				client.EnableSsl = true;
				client.Send(emailLog);
			}
		}
	}
}